<template lang="pug">
  div.kalix-article
    keep-alive
      el-row.frame-row(:gutter="10")
        el-col.frame-col(:span="8" )
          kalix-org-tree(treeTitle="机构列表" v-on:orgTreeClick="onOrgTreeClick")
        el-col.frame-col(:span="16")
          kalix-user.orguser-wrapper(bizKey='orguser' v-bind:targetURL="targetURL"
          v-bind:bizSearch="bizSearch" ref="kalixUser")
</template>

<script type="text/ecmascript-6">
  import KalixUser from '../../auth/user/user.vue'
  import {userURL} from '../../config.toml'

  export default {
    name: 'kalix-admin-orguser',
    data() {
      return {
        targetURL: userURL,
        bizSearch: null
      }
    },
    methods: {
      onOrgTreeClick(data) {
        this.targetURL = `/camel/rest/orgs/${data.id}/users/list`
      }
    },
    components: {
      KalixUser
    }
  }
</script>
